home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Libraries / stdwin / Appls / dpv / README < prev    next >
Encoding:
Text File  |  1988-11-17  |  2.3 KB  |  51 lines  |  [TEXT/????]

  1. Name:        dpv -- Ditroff previewer using STDWIN
  2. Author:        Guido van Rossum
  3. Started:    Jan 12 1988
  4.  
  5. Ditroff output describes pages to be typeset (see comments in the source
  6. for a description).
  7. Pages are started by 'p' commands.
  8. Each page is a contiguous segment of the file, but operations within a
  9. page can contain arbitrary vertical movements.  I have made the decision
  10. not to display the entire file as one document, since this would limit
  11. us to approx. 32 pages (given a practical limit on STDWIN documents of
  12. 32K pixels, and an average screen height of 1K pixels).
  13. To allow reasonably efficient displaying, we need to remember the file
  14. offsets where each page starts in the input, and the state of the
  15. ditroff engine at the start of the page (font etc.).  Thus, we must make
  16. a pre-scan of the input to compute this info; after that, the draw
  17. procedure only needs to read the particular page being displayed.
  18. (Note that it would be easy enough to change the interface so that all
  19. pages are mapped to a single document.)
  20. As an optimization, we actually don't pre-scan the entire file when the
  21. program starts up; rather, when a page is first displayed the pre-scan
  22. information is computed as a by-product of the displaying process.
  23. There are two page numbering schemes: internally, the pages are always
  24. numbered 0, 1, ..., with 0 being the configuration data (everything that
  25. comes before the first 'p' command).  Externally, page numbers are taken
  26. from the argument to the 'p' command.
  27.  
  28. State to remember for each page start:
  29. - mounted fonts ('x f' command)
  30. - character height and slant ('x H' and 'x S' commands) (not used?)
  31. - current font and size
  32.  
  33. The following state, although it can be reset using 'x' commands, is
  34. assumed to be set once and for all on page 0:
  35. - device name ('x T' command)
  36. - resolution ('x r' command)
  37.  
  38. Formally, one should also remember the stack of state records
  39. manipulated by '{' and '}' commands; I assume these are used only by
  40. pictures, and the stack is empty at page boundaries.
  41.  
  42. TO DO:
  43.  
  44. Print special chars as what they should look like, instead of as their
  45. ditroff names.
  46.  
  47. Use real troff fonts.  This requires a translation between ASCII codes
  48. output by ditroff and character codes in the font.  Perhaps the fonts
  49. should be stored different, so that for ASCII at least no mapping is
  50. necessary.
  51.